package com.yutel.phone.binh.service;

import java.util.ArrayList;

import android.content.Intent;
import android.util.Log;

import com.yutel.phone.binh.data.vo.SearchPinyin;

public class SearchService extends SyncService {
	final private static String TAG = "SearchActivity";

	@Override
	protected ArrayList<SearchPinyin> getData(Intent intent) {
		String pinyin = intent.getStringExtra(Intent.EXTRA_TEXT);
		int index = intent.getIntExtra("index", 0);
		int count = intent.getIntExtra("count", 30);
		Log.i(TAG, "pinyin=" + pinyin + ",index=" + index + ",count=" + count);
		SearchPinyin sp = dq.search(pinyin, index, count);
		if (sp != null) {
			ArrayList<SearchPinyin> list = new ArrayList<SearchPinyin>();
			list.add(sp);
			return list;
		}
		return null;
	}

	@Override
	protected String getKey() {
		return this.getClass().getSimpleName();
	}

}
